﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
   <meta charset="utf-8" />
  	  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ManageSystem管理系统</title> 
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/resource/js/jQueryMessage/css/message.skin.css" />
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">更新菜单</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/index/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">更新菜单</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/system/menu/add}" onsubmit="return validateForm();" method="post">
						<input type="hidden" th:value="${menu.menuId}" id="menuId" name="menuId"/>
						<div class="form-group form-control-medium">
							<label for="menuName">菜单名称：</label>
							<input id="menuName" name="menuName" type="text" th:value="${menu.menuName}"  class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="orderNum">显示顺序：</label>
							<input id="orderNum" name="orderNum" type="text" th:value="${menu.orderNum}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="url">URL地址：</label>
							<input id="url" name="url" type="text" th:value="${menu.url}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="icon">菜单图标：</label>
							<input id="icon" name="icon" type="text" th:value="${menu.icon}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="remark">备注说明：</label>
							<input id="remark" name="remark" type="text" th:value="${menu.remark}" class="form-control"/>
						</div>
						<div class="form-group">
							<label for="menuType">菜单类型：</label>
							<label class="checkbox-inline">
								<input type="radio" name="menuType" id="type-yes" value="M" th:checked="${menu.menuType} eq 'M'" >目录
							</label>
							<label class="checkbox-inline">
								<input type="radio" name="menuType" id="type-no" value="C" th:checked="${menu.menuType} eq 'C'">菜单
							</label>
							<label class="checkbox-inline">
								<input type="radio" name="menuType" id="type-yes-no" value="F" th:checked="${menu.menuType} eq 'F'">按钮
							</label>
						</div>
						<div class="form-group">
							<label for="visible">菜单类型：</label>
							<label class="checkbox-inline">
								<input type="radio" name="visible" id="visible-yes" value="0" th:checked="${menu.visible} == '0'">显示
							</label>
							<label class="checkbox-inline">
								<input type="radio" name="visible" id="visible-no" value="1" th:checked="${menu.visible} == '1'">隐藏
							</label>
						</div>

						<input id="updateBy" name="updateBy" type="hidden" class="form-control" />
						<div class="form-btn-group-left">
			            	<button type="submit" class="btn btn-info">保存</button>
							<button type="button" class="btn btn-info" id="back"><a href="/system/menu/list">返回</a></button>
			            </div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/resource/js/jQueryMessage/js/jquery.plugin.message.js"></script>
        <script type="text/javascript" th:inline="javascript">
	   	/* 保存方法 */
	    function validateForm(){
			return true;
	    }

		//获取当前登录的用户
		var userStr = sessionStorage.getItem("douglas");
		if(userStr == null || userStr == "" || userStr == "undefined"){
			window.location.href = "/admin/user/toLogin";
		}else{
			var user = JSON.parse(userStr);
			$("#updateBy").val(user.realname);
		}
    </script>
</body>
</html>
